<?php

namespace CNAM\ActimanBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use CNAM\ActimanBundle\Entity\acProcedure;

/**
 * Phase
 *
 * @ORM\Table()
 * @ORM\Entity
 */
class Phase
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="nomPhase", type="string", length=255)
     */
    private $nomPhase;
    
    /**
     *
     * @ORM\ManyToOne(targetEntity="acProcedure")
     * @ORM\JoinColumn(nullable=false)
     */
    protected $acProcedure;
    
    /**
     *
     * @ORM\OneToMany(targetEntity="Operation",mappedBy="Phase",cascade={"remove"})
     * @ORM\JoinColumn(nullable=false)
     */
    protected $Operations;


    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set nomPhase
     *
     * @param string $nomPhase
     * @return Phase
     */
    public function setNomPhase($nomPhase)
    {
        $this->nomPhase = $nomPhase;

        return $this;
    }

    /**
     * Get nomPhase
     *
     * @return string 
     */
    public function getNomPhase()
    {
        return $this->nomPhase;
    }
    
    
    
    /**
     *
     * @return acProcedure
     */
    public function getAcProcedure() {
        return $this->acProcedure;
    }
    // On renvoie un objet de type procédure avec en parametre une procédure
    /**
     *
     * @param acProcedure $acProcedure
     */
    public function setAcProcedure($acProcedure) {
        $this->acProcedure = $acProcedure;
    }


    /**
     * Constructor
     */
    public function __construct()
    {
        $this->Operations = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Add Operations
     *
     * @param \CNAM\ActimanBundle\Entity\Operation $operations
     * @return Phase
     */
    public function addOperation(\CNAM\ActimanBundle\Entity\Operation $operations)
    {
        $this->Operations[] = $operations;

        return $this;
    }

    /**
     * Remove Operations
     *
     * @param \CNAM\ActimanBundle\Entity\Operation $operations
     */
    public function removeOperation(\CNAM\ActimanBundle\Entity\Operation $operations)
    {
        $this->Operations->removeElement($operations);
    }

    /**
     * Get Operations
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getOperations()
    {
        return $this->Operations;
    }
}
